import { createApp } from 'vue';  
import App from './App.vue';  
  
let instance = null;  
  
// function render() {  
//   instance = createApp(App);  
//   instance.mount('#app');  
// }  
  

function render(props = {}) {
    const { container } = props;
    instance = createApp(App).mount(container ? container.querySelector('#app') : '#app');
  }
if (!window.__POWERED_BY_QIANKUN__) {  
  render();  
}  
  
export async function bootstrap() {  
  console.log('vue app bootstraped');  
}  
  
export async function mount(props) {  
  console.log('props from main framework', props);  
  render(props);  
}  
  
export async function unmount() {  
  instance.unmount();  
  instance.$destroy();  
  instance = null;  
}